home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19970326-19970626 / 000270_news@newsmaster….columbia.edu _Wed Jun 4 23:13:07 1997.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id XAA28433
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Wed, 4 Jun 1997 23:13:07 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id XAA03760
  7.     for kermit.misc@watsun; Wed, 4 Jun 1997 23:13:07 -0400 (EDT)
  8. Path: news.columbia.edu!psinntp!news.idt.net!news.maxwell.syr.edu!newsfeed.internetmci.com!news.dfw.net!news.onramp.net!news-in.iadfw.net!news.gymnet.com!LSNT1!lsbsdi6.lightspeed.net!news-ana-7.sprintlink.net!news-ana-24.sprintlink.net!news-west.sprintlink.net!news-peer.sprintlink.net!news.sprintlink.net!Sprint!howland.erols.net!psinntp!news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc,comp.os.linux.misc
  11. Subject: Re: Transmit drops the last 10-14 characters
  12. Date: 31 May 1997 18:55:16 GMT
  13. Organization: Columbia University
  14. Lines: 68
  15. Message-ID: <29987D592985B0D4.869F72B0460517F0.9AFA0E544A526AF7@library-proxy.airnews.net>
  16. X-Orig-Message-ID: <5mps6k$do2$1@newsmaster.cc.columbia.edu>
  17. References: <338498B1.41C6@raleigh.ibm.com> <5m2brb$5l3$1@newsmaster.cc.columbia.edu> <338FC0D6.69AAE64D@mindspring.com>
  18. NNTP-Proxy-Relay: library.airnews.net
  19. NNTP-Posting-Host: biceps.gymnet.com
  20. Xref: news.columbia.edu comp.protocols.kermit.misc:7121 comp.os.linux.misc:197901
  21.  
  22. In article <338FC0D6.69AAE64D@mindspring.com>,
  23. David Greeson  <dgreeson@mindspring.com> wrote:
  24.  
  25. (Discussing a problem using Linux C-Kermit to transmit bytes to a
  26. microprocessor, but the last few bytes are always lost...)
  27.  
  28. : ....
  29. : > : set file type binary (so it will transfer a byte at a time)
  30. : > : set flow xon
  31. : > :
  32. : > : Then I set the uP to receive the ascii file and type crtl-\c
  33. : > : C-kermit> transmit foo.bar
  34. : > :
  35. : > : The uP receives the whole file except for the last 10-14
  36. : > : characters.  The com port has a 16550A uart.
  37. :
  38. : The uP is using XON/XOFF for flow control and has a 16 byte
  39. : rcv/xmit fifos.  Using port diags on the uP, I do not see
  40. : the last 13 bytes of the file.  Also the port has not
  41. : been overrun'd.  I'm downloading s-records and each line
  42. : has a checksum which is verified.
  43. : ...
  44. : After the transmit finished, I typed  "c" to connect and I
  45. : could type one character and see that the uP port received
  46. : the character.  Also, if I set the uart type on the PC to
  47. : 16450 (setserial /dev/cua1 16450), only the last byte is
  48. : missing.
  49. :
  50. This reinforces my theory about a device driver bug; the last
  51. UART buffer's worth is not being flushed out when the device is 
  52. closed.
  53.  
  54. : I'm not sure what else to try or how to verify if its a kernel
  55. : problem.
  56. Get the Kermit source code:
  57.  
  58.   ftp://kermit.columbia.edu/kermit/archives/cku192.tar.gz
  59.  
  60. uncompress, untar.  Edit the file ckutio.c.  Find the ttres() routine
  61. (the one that restores the modes and settings of the tty device prior to
  62. closing it).  A few lines from the top of this routine:
  63.  
  64. #ifdef  NETCONN
  65.     if (netconn) return (0);            /* Network connection, do nothing */
  66. #endif  /* NETCONN */
  67.     sleep(1);                           /* <--- Add this line */
  68.  
  69. Save the file, then "make linux".  Try your application again.  Does it work?
  70. If so, this means means that tcsetattr() destroys any pending output, which
  71. I would call a bug.
  72.  
  73. If this change did not fix your application, then look for the ttclos()
  74. routine in the same source file (ckutio.c).  A few lines from the top of
  75. ttclos():
  76.  
  77.     if (ttfdflg)                        /* If we inherited ttyfd from */
  78.       return(0);                        /* another process, don't close it. */
  79.     sleep(1);                           /* <--- Add this line */
  80.  
  81. Save the file, "make linux" again, repeat the experiment.  If this change
  82. fixes the problem, it means that close() does not wait for output to drain,
  83. which I also would consider a bug.
  84.  
  85. Please let me know what you find.
  86.  
  87. - Frank
  88.